package com.ruoyi.order.enumration;

import com.google.common.collect.Sets;
import lombok.Getter;

import java.util.Set;

public enum ProcessObjectUnitEnum {

    交通工具(Sets.newHashSet("m2", "m3"), "交通工具"),
    集装箱及装载货物(Sets.newHashSet("20`"), "集装箱及装载货物"),
    散装货物(Sets.newHashSet("吨"), "散装货物"),
    其它(Sets.newHashSet("m2"), "其它"),
    ;

    @Getter
    private Set<String> unitSet;

    @Getter
    private String processObject;

    ProcessObjectUnitEnum(Set<String> unitSet, String processObject) {
        this.unitSet = unitSet;
        this.processObject = processObject;
    }

    public static Set<String> getUnitSet(String processObject) {
        for (ProcessObjectUnitEnum value : ProcessObjectUnitEnum.values()) {
            if (value.processObject.equals(processObject)) {
                return value.unitSet;
            }
        }
        return Sets.newHashSet();
    }
}
